package sealte.wdgf.utils;

import java.sql.ResultSet;
import java.sql.Statement;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class UtilTools {
	
	private static Logger logger = LoggerFactory.getLogger(UtilTools.class);
	
	public static void closeStatementAndResultSet(Statement stmt,ResultSet rs){
		try{
			if(null!=rs){
				rs.close();
				rs = null;
			}
		}catch(Exception ex){
			logger.error("关闭ResultSet时出错！原因："+ex.getMessage());
		}finally{
			try{
				if(null!=stmt){
					stmt.close();
					stmt = null;
				}
			}catch(Exception e){
				logger.error("关闭Statement时出错！原因："+e.getMessage());
			}
		}
	}
	
	
}
